<?php
$a=new hrefcather();
$z=$a->isvedimas();
$updatequery=new queris();

//update field script0

if(isset($_POST['deletor'])){
$updatequery->formdeletor($_POST['idis'],$z->pagetitle);
echo "<script>window.location='index.php';</script>";
}


if(isset($_POST['menus'])){
$updatequery->forminserter($updatequery->queryresult,$_POST['menus'],$_POST['pagetitlas'],$_POST['pagekeywords'],$_POST['pagedescription'],$_POST['content']);
$_POST['menus']=null;
echo "<script>window.location='index.php';</script>";
}

//update script1
if($_POST['pagekeywords']!=null || $_POST['content']!=null){
$updatequery->updatequery1($_POST['pagekeywords'],$_POST['pagedescription'],$_POST['content'],$_POST['pagetitlas'],$_POST['idis']); 
$_POST['pagekeywords']=null;
$_POST['content']=null;
echo "<script>window.location='?$_SERVER[QUERY_STRING]';</script>";
}
echo "<form method='POST' action='?$_SERVER[QUERY_STRING]'>Pasirinktas meniu:";
echo $z->pagetitle."<br><br>";

if($a->status==1){ //isvedam menu punkta inputa
echo "Meniu pavadinimas"."<br>";
echo "<input type=text name='menus' style='width:300px' value=''><br><br>";    
}


echo "Puslapio titulinis pavadinimas(rodomas web lapo viršuje)"."<br>";
echo "<input type=text name='pagetitlas' style='width:300px' value='$z->pagehtmltitle'><br><br>";
echo "<textarea name='content' style='width:100%'>";
echo $z->pagecontent;
echo "</textarea><br>";

echo "Puslapio meta informacija(raktiniai žodziai rašomi per kablelį"."<br>";
echo "<input type=text name='pagekeywords' style='width:300px' value='$z->pagehtmlmeta'><br>";
echo "<input type=hidden value='$z->id' name='idis'>";
echo "Puslapio aprašymas"."<br>";
echo "<input type=text name='pagedescription' style='width:300px' value='$z->pagehtmldescription'><br><br>";
echo "<input type=submit style='background-color:red;font-size:10px;color:white;border:0;line-height:normal' name='saver' value='išsaugoti' >&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=submit style='background-color:red;font-size:10px;color:white;border:0;line-height:normal' name='deletor' value='ištrinti'></form>";


?>